/**
 * 分页构造器
 * @param pageNum 当前页
 * @param pageSize 每页条数
 * @constructor
 */
function Pagination(pageNum, pageSize) {
    this.pageNum = parseInt(pageNum) || 1;
    this.pageSize = parseInt(pageSize) || 1;
    this.pageCount = 0;
    this.totalRows = 0;
}

/**
 * 计算总页数
 */
Pagination.prototype.setPageCount = function() {
    this.pageCount = Math.ceil(this.totalRows/this.pageSize);
};

/**
 * 保存总记录数
 * @param total
 */
Pagination.prototype.setTotalRows = function(total) {
    this.totalRows = total;
};


module.exports = exports = Pagination;
